import torch

a = torch.rand(2, 3)
b = torch.rand(2, 3)
print("a =", a)
print("b =", b)

print(torch.eq(a, b))
print(torch.equal(a, b))
print(torch.ge(a, b))
print(torch.gt(a, b))
print(torch.le(a, b))
print(torch.lt(a, b))

a = torch.tensor([[1, 4, 4, 3, 5], [2, 3, 1, 3, 5]])
print(a.shape)
print("a =", a)
print(torch.sort(a, dim=1, descending=False))
print(torch.sort(a, dim=1, descending=True))

# topk
a = torch.tensor([[1, 4, 4, 3, 5], [2, 3, 1, 3, 5]])